package cn.wolfcode.wolf2w.business.api;

import cn.wolfcode.wolf2w.business.api.domain.StrategyCondition;
import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import cn.wolfcode.wolf2w.common.core.domain.R;
import cn.wolfcode.wolf2w.business.api.domain.Strategy;
import cn.wolfcode.wolf2w.business.api.factory.RemoteStrategyFallbackFactory;
import cn.wolfcode.wolf2w.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Stack;

/**
* 攻略 远程服务
 *
 * @author dh
 * @date 2025-09-16
 */
@FeignClient(contextId = "RemoteStrategyService", name = ServiceNameConstants.STRATEGY_SERVICE, fallbackFactory = RemoteStrategyFallbackFactory.class)
public interface RemoteStrategyService {

    @GetMapping("/strategies/feign/list")
    R<List<Strategy>> list(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/strategies/feign/{id}")
    R<Strategy> getOne(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 排行榜
     * @param source 指定来源 inner表示内部
     * @return
     */
    @PostMapping("/strategies/feign/statisRank")
    R<Strategy> statisRank(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/strategies/feign/statisCondition")
    R<StrategyCondition>  statisCondition(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @PostMapping("/strategies/feign/strategyStatisHashPersistence")
    R<StrategyCondition>  strategyStatisHashPersistence(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
